package com.ecjtu.stadiumre_servations.service.impl;

import com.ecjtu.stadiumre_servations.config.RabbitMQConfig;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

import java.util.Map;
@Service
public class PaymentNoticeConsumer {
    @RabbitListener(queues = RabbitMQConfig.PAYMENT_NOTICE_QUEUE_NAME)
    public void handlePaymentNotice(Map<String, String> noticeMessage){
        String userId = noticeMessage.get("userId");
        String message = noticeMessage.get("message");
        // 这里可以实现具体的通知逻辑，如发送短信、站内信等
        System.out.println("向用户 " + userId + " 发送通知：" + message);
    }
}